import pymongo

class MongoConfig:
    def __init__(self):
        self.client = pymongo.MongoClient("mongodb://localhost:27017/")
        self.db = self.client["bilibili"]
        self.collection = self.db["danmaku"]

    def get_mongo_collection(self):
        return self.collection

    def close_mongo_client(self):
        self.client.close()
